<!DOCTYPE html>
<html>
<head>
    {include file='public/meta'/}
<link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/tidy.css"/>

    <script src="__STATIC_URL__/static/laydate/laydate.js"></script>
    <script src="__STATIC_URL__/static/js/times.js"></script>
</head>
<body>
{include file='public/header'/}
<section>
    <!------------------导航-------------------------->
    {include file='public/left'/}
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <div class="page-heading mgr15 mgl15">
            <ul class="breadcrumb">
                <li>
                    当前位置是&nbsp;:&nbsp;<a href="{:url('shop/shopmall',['card_id'=>$card['card_id']])}"> 积分商城</a>
                </li>
                <li class="active" style="color: #02b87f;">订单管理</li>
            </ul>
        </div>
        <div class="panel panel-default mgr15 mgl15">
            <div class="panel-heading">
                <h3 class="panel-title">
                    筛选分类
                </h3>
            </div>
            <div class="panel-body">
                <form action="" method="get" class="form-horizontal table-search form-search" role="form" id="machform">
                    <div class="col-sm-6 col-md-4 col-lg-4 col-slg-4">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">商品名称：</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" id="goods_name" placeholder="请输入"
                                       value="{$p_data['goods_name']}" name="goods_name">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-4 col-lg-4 col-slg-4">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">订单状态：</label>
                            <div class="col-sm-9">
                                <select name="statu" id="statu" class="form-control">
                                    <option value="">请选择</option>
                                    <option value="0" {if condition="$p_data['statu'] eq '0'" }selected{
                                    /if}>正常</option>
                                    <option value="1" {if condition="$p_data['statu'] eq '1'" }selected{
                                    /if}>关闭</option>
                                    <option value="2" {if condition="$p_data['statu'] eq '2'" }selected{
                                    /if}>完成</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-4 col-lg-4 col-slg-4">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">兑换时间：</label>
                            <div class="col-sm-9">
                                <input name="search_date" type="text" value=""
                                       readonly="readonly" id="search_date" class="form-control"
                                       placeholder="请选择" style="width: 297px">
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="panel-footer">
                <a href="javascript:;" class="btn btn-primary" onclick="searchform()">查找</a>
                <a href="javascript:;" class="btn btn-default" onclick="clearform()">清空</a>
            </div>
        </div>
        <div class="panel mgl15 mgr15">

            <div class="panel-heading addCharts mgb10" style="background:#ededed;">订单列表</div>
            <div class="panel-body">

                <table class="table table-bordered" data-toolbar="#normal">
                    <thead>
                    <tr>
                        <th>商品名称</th>
                        <th>商品图片</th>
                        <th>兑换积分</th>
                        <th>兑换数量</th>
                        <th>订单状态</th>
                        <th>创建时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name="list" id="vo"}
                    <tr>
                        <td>{:get_goods_info($vo.gid,'1')}</td>
                        <td><img src="{:get_goods_info($vo.gid,'2')}" style="width:40px;height:40px;"/></td>
                        <td>{$vo.price}</td>
                        <td>{$vo.number}</td>
                        <td>
                            {switch name="$vo.statu"}
                            {case value="0"}正常{/case}
                            {case value="1"}已关闭{/case}
                            {case value="2"}完成{/case}
                            {/switch}
                        </td>
                        <td>{$vo['create_time']}</td>
                        <td class="chakan">
                            <a class="btn-link" href="{:url('Shop/orderinfo',['id'=>$vo['id'],'card_id'=>$vo['card_id']])}">查看</a>
                            {eq name="vo.statu" value='0'}
                            | <a class="text-danger"  href="{:url('Shop/orderoff',['id'=>$vo['id'],'card_id'=>$vo['card_id']])}">关闭</a>
                            {/eq}
                        </td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
                {$list->render()}

            </div>
        </div>
        {include file='public/footer'/}
    </div>

    </div>
</section>
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">二维码预览</h4>
            </div>
            <div class="modal-body">
                <img src="" class="img-responsive" id="modalcode" style="margin: 0 auto;">
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal">确认</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
</body>
<script type="text/javascript">
    $(function () {

        $(".glyphicon-qrcode").click(function () {
            var src = $(this).attr("data-src");
            if (!!src) {
                $("#modalcode").attr("src", src);
                $("#myModal").modal("show");
            } else {
                alert("未获得二维码")
            }
        });
        $("#myModal").on("hide.bs.modal", function () {
            $("#modalcode").attr("src", "");
        })
    })
</script>
</html>
